#pragma  once

const CString StrRegMem32 = _T("r/m32");
const CString StrRegMem8 = _T("r/m8");
const CString StrRegMem16 = _T("r/m16");
const CString StrReg32 = _T("r32");
const CString StrReg8  = _T("r8");
const CString StrDisp32  = _T("disp32");
const CString StrDisp8  = _T("disp8");
const CString StrImm8  = _T("imm8");
const CString StrImm16  = _T("imm16");
const CString StrImm32  = _T("imm32");
const CString StrRel32  = _T("rel32");
const CString StrRel8  = _T("rel8");
const CString StrSegOffset32  = _T("moffs32");
const CString StrDWORDPTR  = _T("DWORD PTR ");
const CString StrWORDPTR  = _T("WORD PTR ");
const CString StrBYTEPTR  = _T("BYTE PTR ");
const CString StrSigExt8  = _T("SigExt8");

const CString StrEAX = _T("EAX");
const CString StrECX = _T("ECX");
const CString StrEDX = _T("EDX");
const CString StrEBX = _T("EBX");
const CString StrESP = _T("ESP");
const CString StrEBP = _T("EBP");
const CString StrESI  = _T("ESI");
const CString StrEDI  = _T("EDI");
const CString StrEIP  = _T("EIP");
const CString StrAL = _T("AL");
const CString StrCL = _T("CL");
const CString StrDL = _T("DL");
const CString StrBL = _T("BL");
const CString StrComma = _T(",");
const CString StrOpenBracket  = _T("[");
const CString StrCloseBracket  = _T("]");
const CString StrSIB  = _T("[--][--]");
const CString StrAsterisk  = _T("*");
const CString StrNone  = _T("none");
const CString StrPlus  = _T("+");
const CString StrNegetive  = _T("-");
const CString StrSpace  = _T(" ");

const CString StrFS  = _T("FS");
const CString StrPtrOverride  = _T("PtrOverride");

const CString StrNeedModConfirm = _T("NeedModConfirm");
const CString StrNeedMoreOperandCode = _T("NeedMoreOperandCode");

const CString StrTest = _T("TEST");
const CString StrAnd = _T("AND");
const CString StrMov  = _T("MOV");
const CString StrMovZX  = _T("MOVZX");
const CString StrPush  = _T("PUSH");
const CString StrSub  = _T("SUB");
const CString StrSbb  = _T("SBB");
const CString StrXor  = _T("XOR");
const CString StrLea  = _T("LEA");
const CString StrCall  = _T("CALL");
const CString StrAdd  = _T("ADD");
const CString StrCmp = _T("CMP");
const CString StrJE = _T("JE");
const CString StrJNE = _T("JNE");
const CString StrJNB = _T("JNB");
const CString StrJB = _T("JB");
const CString StrJA = _T("JA");
const CString StrJBE = _T("JBE");
const CString StrSetNE = _T("SETNE");
const CString StrSetE = _T("SETE");
const CString StrJMP = _T("JMP");
const CString StrInc = _T("INC");
const CString StrOR = _T("OR");
const CString StrPop = _T("POP");
const CString StrRet = _T("RET");
const CString StrEmpty = _T("");
const CString StrEnter = _T("\n");
const CString StrNeg = _T("NEG");
const CString StrSAL = _T("SAL");
const CString StrSTC = _T("STC");
const CString StrSHR = _T("SHR");
const CString StrREP = _T("REP");
const CString StrSTOS = _T("STOS");
const CString StrIMUL = _T("IMUL");
const CString StrDec = _T("DEC");
const CString StrCMPXCHG = _T("CMPXCHG");
const CString StrInterrupt = _T("INT");

bool GetOpCode(BYTE opByte, CString & opCodeStr);
bool GetExtendedOpCode(BYTE opByte, BYTE modRM, CString & opCodeStr);
void PraseModRMReg(BYTE modRM, CString& regStr);
void PraseModRMEffAddr(BYTE modRM, CString& effAddrStr);
void PraseSIBBase(BYTE SIBByte, CString& SIBBaseStr);
void PraseSIBScaleIndex(BYTE SIBByte, CString& SIBScaleIndexStr);
bool MapReg32To8(CString & regStr);
bool MapReg32To16(CString & regStr);
bool IsMemAddrFormat(CString opCodeStr);
DWORD GetSrcDWFromStr(CString opCodeStr);
bool FindInstructionDNA(const CString opCodeStr, CString DNAInstructionStr);
bool IsReg32(CString & regStr);